<template>
  <!-- 地址选择器 -->
  <Top-Page>
    <cc-selectDity
      :province="province"
      :city="city"
      :area="area"
      :show="show"
      @changeClick="changeClick"
      @sureSelectArea="onsetCity"
      @hideShow="onhideShow"
    ></cc-selectDity>
  </Top-Page>
</template>

<script>
export default {
  data() {
    return {
      province: '北京',
      city: '北京市',
      area: '东城区',
      areaCode: '110101',
      show: false,
      present_address_show: false
    };
  },
  components: {},
  methods: {
    changeClick(value, value2, value3, value4) {
      this.province = value;
      this.city = value2;
      this.area = value3;
      this.areaCode = value4;
    },
    //选中省市区
    onsetCity(e) {
      let data = e.detail.target.dataset;
      let address = data.province + data.city + data.area;
      this.show = false;

      this.province = data.province;
      this.city = data.city;
      this.area = data.area;
    },

    onhideShow() {
      this.show = false;
      this.present_address_show = false;
    }
  }
};
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
